package Homework05;

import java.util.ArrayList;

public class Homework07 {
	public static void main(String[] args) {
        String str1 = "ppRYYGrYBR2258";
        String str2 = "YrR8RrY";

        ArrayList<Character> list1 = new ArrayList<>();
        ArrayList<Character> list2 = new ArrayList<>();

        for (int i = 0; i<str1.length(); i++) {
            list1.add(str1.charAt(i));
        }
        for (int i = 0; i<str2.length(); i++) {
            list2.add(str2.charAt(i));
        }

        for(int i=0;i<list2.size();i++){
        	there:for(int j=0;j<list1.size();j++){
        		if(list1.get(j)==list2.get(i)){
        			list1.remove(j);
        			break there;
        		}
        	}
        }

        if (list1.size() == str1.length() - str2.length()) {
        	
            System.out.println("Yes " + list1.size());
        } else {
            System.out.println("No");
        }
    }
}

